<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="sec"
	uri="http://www.springframework.org/security/tags"%>


<style type="text/css">

table {
	width: 750px;
	border-collapse: collapse;
	text-align: center;
	font-family: 'Trebuchet MS';
}

td,th {
	font-size: 9pt;
	border: 1px solid #ffffff;
	height: 30px;
}

th {
	background-color: #5075dd;
	color: #ffffff;
	font-family: Georgia;
}

tr.alt td {
	color: #000000;
	background-color: #EAF2D3;
}

.bt_view {
	background-color: #8099de;
	border: 1px solid #999;
	width: 80px;
	height: 18px;
	border-radius: 8px;
	border: none;
	margin: 0 0 0 5px;
	font-weight: bold;
	font-size: 0.9em;
	color: #FFF;
	background-image: url(../images/member/dup.jpg);
	background-repeat: repeat-x;
	background-position: center center;
}
</style>

<h1 align="center">Subject List</h1>
<br>
<sec:authorize ifAllGranted="ROLE_EMPLOYEE">
	<form method="POST" action="<c:url value="/subject/addSJ"/>">
		<input type="text" name="sjName" size="28" /> <input type="submit"
			value="추가" class="bt_view" />
		<p>
	</form>
</sec:authorize>
<table>
	<tr>
		<th>과목번호</th>
		<th>과목이름</th>
		<sec:authorize ifAllGranted="ROLE_EMPLOYEE">
			<th></th>
		</sec:authorize>
	</tr>

	<c:forEach items="${sjList }" var="subject">
		<tr>
			<td>${subject.subjectId }</td>
			<td>${subject.title }</td>
			<sec:authorize ifAllGranted="ROLE_EMPLOYEE">
				<td>
					<form method="post" action="<c:url value="/subject/removeSJ"/>">
						<input name="subSeq" type="hidden" value="${subject.subjectId }" />
						<input type="submit" value="삭제" class="bt_view" />
					</form>
				</td>
			</sec:authorize>
			<!--  <td><input type="submit" onclick="remove?memberName=${guest.name }" value="삭제" /></td>-->
			<!-- <td><a href="remove?memberName=${guest.name }">remove</a></td> -->
		</tr>
	</c:forEach>
</table>

